import logging,yagmail

import HTMLTestRunner_cn

class Tools():
    def report(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(open('Movie_cn.html','wb'),
                                                  title='酒仙测试报告',
                                                  description='包含6条测试用例，里面有数据驱动')
        return report

    def Log(self):
        log=logging.basicConfig(filename='../jiuxian.log',
                                level=logging.DEBUG,
                                format='%(levelname)s-%(asctime)s-%(filename)s-%(message)s-%(lineno)d',
                                filemode='a+')
        return log

    def send_maill(self):
        mail=yagmail.SMTP(user='3047217905@qq.com',password='wsmqyonwzaxqdcgj',host='smtp.qq.com',port='465')
        mail.send(to='3047217905@qq.com',subject='酒仙自动化测试报告',contents=['TestRunner.py','jiuxian.log'])
        mail.close()